//
//  BaseNSObject.m
//  Inforcollection
//
//  Created by macbook on 15/12/3.
//  Copyright © 2015年 oceansoft.liw. All rights reserved.
//

#import "BaseNSObject.h"

@implementation BaseNSObject

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}
//判断字符串是否为空
-(NSString *)checkStr:(NSString *)str
{
    if(str!=nil && ![str isKindOfClass:[NSNull class]])
    {
        return str;
    }
    else
    {
        return @"";
    }
}
//时间戳转换成YYYY-MM-DD
-(NSString *)strChangeDate:(NSString *)dateStr
{
    NSDate *currentDate=[NSDate dateWithTimeIntervalSince1970:[dateStr longLongValue]/1000];
    
    NSDateFormatter *formatter=[[NSDateFormatter alloc]init];
    
    [formatter setDateFormat:@"yyyy-MM-dd"];
    
    NSString *currentDateStr=[formatter stringFromDate:currentDate];
    
    return currentDateStr;
}

@end
